using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Runtime.Serialization;
using System.Collections.Concurrent;
using System.ServiceModel;
using GZ.Common.Data;
using System.Configuration;
using Newtonsoft.Json;
using GZ.Common.Code;
using GZ.DB.Repository.wcs_hy;
using GZ.DB.Entity.wcs_hy;
using GZ.DB.IRepository.wcs_hy;
using static GZ.Projects.WCS_SVC.WMSHttpEntity;
using System.Net;
using System.Net.NetworkInformation;
namespace GZ.Projects.WCS_SVC
{
	/// <summary>
	/// 变量数据库
	/// </summary>
	public class Tag : System.ComponentModel.INotifyPropertyChanged
	{
		#region 变量
		#region 内置变量
		private Dictionary<string, string> _Languages;
		public Dictionary<string,string> Languages
		{
            get
            {
				return _Languages;
            }
            set
            {
				_Languages = value;
				RaisePropertyChanged("Languages");
            }
        }

		private string _Lang;
		public string Lang
		{
			get
			{
				return _Lang;
			}
			set
			{
				_Lang = value;
				RaisePropertyChanged("Lang");
                try
				{
					if (_Languages.Any())
					{
						Application.Current.Resources.MergedDictionaries.Clear();
						Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri(new StringBuilder().AppendFormat(@"资源/语言/{0}.xaml", _Lang).ToString(), UriKind.Relative) });
					}
				}
                catch(Exception ex)
                {
					MessageBox.Show("切换语言异常:" + ex.Message);
                }
			}
		}
		#endregion
		#endregion
		
		#region 变量组
		private Tag菜单按钮颜色 _菜单按钮颜色 = new Tag菜单按钮颜色();
		public Tag菜单按钮颜色 菜单按钮颜色 { get { return _菜单按钮颜色; } set { _菜单按钮颜色=value; RaisePropertyChanged("菜单按钮颜色"); } }
		private Tag界面 _界面 = new Tag界面();
		public Tag界面 界面 { get { return _界面; } set { _界面=value; RaisePropertyChanged("界面"); } }
		private TagWMS接口 _WMS接口 = new TagWMS接口();
		public TagWMS接口 WMS接口 { get { return _WMS接口; } set { _WMS接口=value; RaisePropertyChanged("WMS接口"); } }
		#endregion
		
		#region 内部类
			public class Tag菜单按钮颜色 : System.ComponentModel.INotifyPropertyChanged
	{
		#region 变量
		private System.String _首页="#007ACC";
		public System.String 首页
		{
			get 
			{
	return _首页; 
			}
			set 
			{
				_首页 = value; 
				RaisePropertyChanged("首页"); 
			}
		}
		private System.String _WCS2WMS服务="#007ACC";
		public System.String WCS2WMS服务
		{
			get 
			{
	return _WCS2WMS服务; 
			}
			set 
			{
				_WCS2WMS服务 = value; 
				RaisePropertyChanged("WCS2WMS服务"); 
			}
		}
		private System.String _退出="#007ACC";
		public System.String 退出
		{
			get 
			{
	return _退出; 
			}
			set 
			{
				_退出 = value; 
				RaisePropertyChanged("退出"); 
			}
		}
		private System.String _当前时间="时间: *******";
		public System.String 当前时间
		{
			get 
			{
	return _当前时间; 
			}
			set 
			{
				_当前时间 = value; 
				RaisePropertyChanged("当前时间"); 
			}
		}
		private System.String _流程控制="#007ACC";
		public System.String 流程控制
		{
			get 
			{
	return _流程控制; 
			}
			set 
			{
				_流程控制 = value; 
				RaisePropertyChanged("流程控制"); 
			}
		}
		#endregion
		
		#region 变量组
		#endregion
		
		#region 内部类
		
		#endregion
			
		#region 属性变更
		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
		public void RaisePropertyChanged(string propertyName)
		{
			System.ComponentModel.PropertyChangedEventHandler handler = PropertyChanged;
			if (handler != null)
			{
				handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
			}
		}
		#endregion
	}

	public class Tag界面 : System.ComponentModel.INotifyPropertyChanged
	{
		#region 变量
		private System.String _LogCreateOrder="";
		public System.String LogCreateOrder
		{
			get 
			{
	return _LogCreateOrder; 
			}
			set 
			{
				_LogCreateOrder = value; 
				RaisePropertyChanged("LogCreateOrder"); 
			}
		}
		private System.String _LogOpeOrder="";
		public System.String LogOpeOrder
		{
			get 
			{
	return _LogOpeOrder; 
			}
			set 
			{
				_LogOpeOrder = value; 
				RaisePropertyChanged("LogOpeOrder"); 
			}
		}
		private System.String _LogOrderPriority="";
		public System.String LogOrderPriority
		{
			get 
			{
	return _LogOrderPriority; 
			}
			set 
			{
				_LogOrderPriority = value; 
				RaisePropertyChanged("LogOrderPriority"); 
			}
		}
		private System.String _LogDeviceStatus="";
		public System.String LogDeviceStatus
		{
			get 
			{
	return _LogDeviceStatus; 
			}
			set 
			{
				_LogDeviceStatus = value; 
				RaisePropertyChanged("LogDeviceStatus"); 
			}
		}
		private System.String _WCS2WMS_Addr="";
		public System.String WCS2WMS_Addr
		{
			get 
			{
	return _WCS2WMS_Addr; 
			}
			set 
			{
				_WCS2WMS_Addr = value; 
				RaisePropertyChanged("WCS2WMS_Addr"); 
			}
		}
		private System.String _WCS2WMS_State="";
		public System.String WCS2WMS_State
		{
			get 
			{
	return _WCS2WMS_State; 
			}
			set 
			{
				_WCS2WMS_State = value; 
				RaisePropertyChanged("WCS2WMS_State"); 
			}
		}
		private System.String _WCS2WMS_StateColor="LightGreen";
		public System.String WCS2WMS_StateColor
		{
			get 
			{
	return _WCS2WMS_StateColor; 
			}
			set 
			{
				_WCS2WMS_StateColor = value; 
				RaisePropertyChanged("WCS2WMS_StateColor"); 
			}
		}
		private System.String _WCS2AGV_Addr="";
		public System.String WCS2AGV_Addr
		{
			get 
			{
	return _WCS2AGV_Addr; 
			}
			set 
			{
				_WCS2AGV_Addr = value; 
				RaisePropertyChanged("WCS2AGV_Addr"); 
			}
		}
		private System.String _WCS2AGV_State="";
		public System.String WCS2AGV_State
		{
			get 
			{
	return _WCS2AGV_State; 
			}
			set 
			{
				_WCS2AGV_State = value; 
				RaisePropertyChanged("WCS2AGV_State"); 
			}
		}
		private System.String _WCS2AGV_StateColor="LightGreen";
		public System.String WCS2AGV_StateColor
		{
			get 
			{
	return _WCS2AGV_StateColor; 
			}
			set 
			{
				_WCS2AGV_StateColor = value; 
				RaisePropertyChanged("WCS2AGV_StateColor"); 
			}
		}
		#endregion
		
		#region 变量组
		#endregion
		
		#region 内部类
		
		#endregion
			
		#region 属性变更
		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
		public void RaisePropertyChanged(string propertyName)
		{
			System.ComponentModel.PropertyChangedEventHandler handler = PropertyChanged;
			if (handler != null)
			{
				handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
			}
		}
		#endregion
	}

	public class TagWMS接口 : System.ComponentModel.INotifyPropertyChanged
	{
		#region 变量
		private System.String _TXT_tray_code;
		public System.String TXT_tray_code
		{
			get 
			{
	return _TXT_tray_code; 
			}
			set 
			{
				_TXT_tray_code = value; 
				RaisePropertyChanged("TXT_tray_code"); 
			}
		}
		private System.String _TXT_task_no;
		public System.String TXT_task_no
		{
			get 
			{
	return _TXT_task_no; 
			}
			set 
			{
				_TXT_task_no = value; 
				RaisePropertyChanged("TXT_task_no"); 
			}
		}
		private System.String _TXT_StartTime;
		public System.String TXT_StartTime
		{
			get 
			{
	return _TXT_StartTime; 
			}
			set 
			{
				_TXT_StartTime = value; 
				RaisePropertyChanged("TXT_StartTime"); 
			}
		}
		private System.String _TXT_EndTime;
		public System.String TXT_EndTime
		{
			get 
			{
	return _TXT_EndTime; 
			}
			set 
			{
				_TXT_EndTime = value; 
				RaisePropertyChanged("TXT_EndTime"); 
			}
		}
		private System.Object _List_SystemPost;
		public System.Object List_SystemPost
		{
			get 
			{
	return _List_SystemPost; 
			}
			set 
			{
				_List_SystemPost = value; 
				RaisePropertyChanged("List_SystemPost"); 
			}
		}
		#endregion
		
		#region 变量组
		#endregion
		
		#region 内部类
		
		#endregion
			
		#region 属性变更
		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
		public void RaisePropertyChanged(string propertyName)
		{
			System.ComponentModel.PropertyChangedEventHandler handler = PropertyChanged;
			if (handler != null)
			{
				handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
			}
		}
		#endregion
	}


		#endregion
			
		#region 属性变更
		public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
		public void RaisePropertyChanged(string propertyName)
		{
			System.ComponentModel.PropertyChangedEventHandler handler = PropertyChanged;
			if (handler != null)
			{
				handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
			}
		}
		#endregion
	}

}
